package com.mk.controller.user;

import com.mk.entity.Pet;
import com.mk.result.Result;
import com.mk.service.IPetService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/education")
@RequiredArgsConstructor
public class EducationController {

    private final IPetService petService;

    /**
     * 根据宠物id扣减宠物违法分数
     * @param petId
     * @param score
     * @return
     */
    @CrossOrigin
    @PutMapping("/deduct")
    public Result deductPoints(Long petId, Integer score) {
        petService.deductPoints(petId, score);
        return Result.success();
    }

    //TODO 公益活动公示
}
